
'===============================================================================
'  Generated From - VbNet_SQL_dOOdads_BusinessEntity.vbgen
' 
'  ** IMPORTANT  **
'  How to Generate your stored procedures:
' 
'  SQL        = SQL_StoredProcs.vbgen
'  ACCESS     = Access_StoredProcs.vbgen
'  ORACLE     = Oracle_StoredProcs.vbgen
'  FIREBIRD   = FirebirdStoredProcs.vbgen
'  POSTGRESQL = PostgreSQL_StoredProcs.vbgen
'
'  The supporting base class SqlClientEntity is in the Architecture directory in "dOOdads".
'  
'  This object is 'MustInherit' which means you need to inherit from it to be able
'  to instantiate it.  This is very easilly done. You can Override properties and
'  methods in your derived class, this allows you to regenerate this class at any
'  time and not worry about overwriting custom code. 
'
'  NEVER EDIT THIS FILE.
'
'  Public Class YourObject
'    Inherits _YourObject
'
'  End Class
'
'===============================================================================

' Generated by MyGeneration Version # (1.3.0.3)

Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Collections
Imports System.Collections.Specialized

Imports MyGeneration.dOOdads

NameSpace ClassSigeco

Public MustInherit Class _si_recibo_detalle
	Inherits SqlClientEntity

		Public Sub New() 
			Me.QuerySource = "si_recibo_detalle"
			Me.MappingName = "si_recibo_detalle"
		End Sub

	'=================================================================
	'  Public Overrides Sub AddNew()
	'=================================================================
	'
	'=================================================================
	Public Overrides Sub AddNew()
		MyBase.AddNew()
				
	End Sub
	
	Public Overrides Sub FlushData()
		Me._whereClause = nothing
		Me._aggregateClause = nothing		
		MyBase.FlushData()
	End Sub
	
		
	'=================================================================
	'  	Public Function LoadAll() As Boolean
	'=================================================================
	'  Loads all of the records in the database, and sets the currentRow to the first row
	'=================================================================
	Public Function LoadAll() As Boolean
	
		Dim parameters As ListDictionary = Nothing
		
		
    	Return MyBase.LoadFromSql("[" + Me.SchemaStoredProcedure + "proc_si_recibo_detalleLoadAll]", parameters)
		
	End Function

	'=================================================================
	' Public Overridable Function LoadByPrimaryKey()  As Boolean
	'=================================================================
	'  Loads a single row of via the primary key
	'=================================================================
        Public Overridable Function LoadByPrimaryKey(ByVal IdReciboDetalle As Integer) As Boolean

            Dim parameters As ListDictionary = New ListDictionary()
            parameters.Add(_si_recibo_detalle.Parameters.IdReciboDetalle, IdReciboDetalle)


            Return MyBase.LoadFromSql("[" + Me.SchemaStoredProcedure + "proc_si_recibo_detalleLoadByPrimaryKey]", parameters)

        End Function

#Region "Parameters"
        Protected Class Parameters

            Public Shared ReadOnly Property IdReciboDetalle() As SqlParameter
                Get
                    Return New SqlParameter("@IdReciboDetalle", SqlDbType.Int, 0)
                End Get
            End Property

            Public Shared ReadOnly Property IdRecibo() As SqlParameter
                Get
                    Return New SqlParameter("@IdRecibo", SqlDbType.Int, 0)
                End Get
            End Property

            Public Shared ReadOnly Property IdVenta() As SqlParameter
                Get
                    Return New SqlParameter("@IdVenta", SqlDbType.Int, 0)
                End Get
            End Property

            Public Shared ReadOnly Property FormaPago() As SqlParameter
                Get
                    Return New SqlParameter("@FormaPago", SqlDbType.NVarChar, 50)
                End Get
            End Property

            Public Shared ReadOnly Property Monto() As SqlParameter
                Get
                    Return New SqlParameter("@Monto", SqlDbType.Decimal, 0)
                End Get
            End Property

            Public Shared ReadOnly Property Observaciones() As SqlParameter
                Get
                    Return New SqlParameter("@Observaciones", SqlDbType.NVarChar, 100)
                End Get
            End Property

            Public Shared ReadOnly Property IdCaja() As SqlParameter
                Get
                    Return New SqlParameter("@IdCaja", SqlDbType.Int, 0)
                End Get
            End Property

            Public Shared ReadOnly Property FechaCaja() As SqlParameter
                Get
                    Return New SqlParameter("@FechaCaja", SqlDbType.DateTime, 0)
                End Get
            End Property

            Public Shared ReadOnly Property IdBanco() As SqlParameter
                Get
                    Return New SqlParameter("@IdBanco", SqlDbType.Int, 0)
                End Get
            End Property

            Public Shared ReadOnly Property NroCheque() As SqlParameter
                Get
                    Return New SqlParameter("@NroCheque", SqlDbType.NVarChar, 50)
                End Get
            End Property

            Public Shared ReadOnly Property Titular() As SqlParameter
                Get
                    Return New SqlParameter("@Titular", SqlDbType.NVarChar, 100)
                End Get
            End Property

            Public Shared ReadOnly Property FechaChequeDiferido() As SqlParameter
                Get
                    Return New SqlParameter("@FechaChequeDiferido", SqlDbType.DateTime, 0)
                End Get
            End Property

        End Class
#End Region

#Region "ColumnNames"
        Public Class ColumnNames

            Public Const IdReciboDetalle As String = "idReciboDetalle"
            Public Const IdRecibo As String = "idRecibo"
            Public Const IdVenta As String = "idVenta"
            Public Const FormaPago As String = "formaPago"
            Public Const Monto As String = "monto"
            Public Const Observaciones As String = "observaciones"
            Public Const IdCaja As String = "idCaja"
            Public Const FechaCaja As String = "fechaCaja"
            Public Const IdBanco As String = "idBanco"
            Public Const NroCheque As String = "nroCheque"
            Public Const Titular As String = "titular"
            Public Const FechaChequeDiferido As String = "fechaChequeDiferido"

            Public Shared Function ToPropertyName(ByVal columnName As String) As String

                If ht Is Nothing Then

                    ht = New Hashtable

                    ht(IdReciboDetalle) = _si_recibo_detalle.PropertyNames.IdReciboDetalle
                    ht(IdRecibo) = _si_recibo_detalle.PropertyNames.IdRecibo
                    ht(IdVenta) = _si_recibo_detalle.PropertyNames.IdVenta
                    ht(FormaPago) = _si_recibo_detalle.PropertyNames.FormaPago
                    ht(Monto) = _si_recibo_detalle.PropertyNames.Monto
                    ht(Observaciones) = _si_recibo_detalle.PropertyNames.Observaciones
                    ht(IdCaja) = _si_recibo_detalle.PropertyNames.IdCaja
                    ht(FechaCaja) = _si_recibo_detalle.PropertyNames.FechaCaja
                    ht(IdBanco) = _si_recibo_detalle.PropertyNames.IdBanco
                    ht(NroCheque) = _si_recibo_detalle.PropertyNames.NroCheque
                    ht(Titular) = _si_recibo_detalle.PropertyNames.Titular
                    ht(FechaChequeDiferido) = _si_recibo_detalle.PropertyNames.FechaChequeDiferido

                End If

                Return CType(ht(columnName), String)

            End Function

            Private Shared ht As Hashtable = Nothing
        End Class
#End Region

#Region "PropertyNames"
        Public Class PropertyNames

            Public Const IdReciboDetalle As String = "IdReciboDetalle"
            Public Const IdRecibo As String = "IdRecibo"
            Public Const IdVenta As String = "IdVenta"
            Public Const FormaPago As String = "FormaPago"
            Public Const Monto As String = "Monto"
            Public Const Observaciones As String = "Observaciones"
            Public Const IdCaja As String = "IdCaja"
            Public Const FechaCaja As String = "FechaCaja"
            Public Const IdBanco As String = "IdBanco"
            Public Const NroCheque As String = "NroCheque"
            Public Const Titular As String = "Titular"
            Public Const FechaChequeDiferido As String = "FechaChequeDiferido"

            Public Shared Function ToColumnName(ByVal propertyName As String) As String

                If ht Is Nothing Then

                    ht = New Hashtable

                    ht(IdReciboDetalle) = _si_recibo_detalle.ColumnNames.IdReciboDetalle
                    ht(IdRecibo) = _si_recibo_detalle.ColumnNames.IdRecibo
                    ht(IdVenta) = _si_recibo_detalle.ColumnNames.IdVenta
                    ht(FormaPago) = _si_recibo_detalle.ColumnNames.FormaPago
                    ht(Monto) = _si_recibo_detalle.ColumnNames.Monto
                    ht(Observaciones) = _si_recibo_detalle.ColumnNames.Observaciones
                    ht(IdCaja) = _si_recibo_detalle.ColumnNames.IdCaja
                    ht(FechaCaja) = _si_recibo_detalle.ColumnNames.FechaCaja
                    ht(IdBanco) = _si_recibo_detalle.ColumnNames.IdBanco
                    ht(NroCheque) = _si_recibo_detalle.ColumnNames.NroCheque
                    ht(Titular) = _si_recibo_detalle.ColumnNames.Titular
                    ht(FechaChequeDiferido) = _si_recibo_detalle.ColumnNames.FechaChequeDiferido

                End If

                Return CType(ht(propertyName), String)

            End Function

            Private Shared ht As Hashtable = Nothing

        End Class
#End Region

#Region "StringPropertyNames"
        Public Class StringPropertyNames

            Public Const IdReciboDetalle As String = "s_IdReciboDetalle"
            Public Const IdRecibo As String = "s_IdRecibo"
            Public Const IdVenta As String = "s_IdVenta"
            Public Const FormaPago As String = "s_FormaPago"
            Public Const Monto As String = "s_Monto"
            Public Const Observaciones As String = "s_Observaciones"
            Public Const IdCaja As String = "s_IdCaja"
            Public Const FechaCaja As String = "s_FechaCaja"
            Public Const IdBanco As String = "s_IdBanco"
            Public Const NroCheque As String = "s_NroCheque"
            Public Const Titular As String = "s_Titular"
            Public Const FechaChequeDiferido As String = "s_FechaChequeDiferido"

        End Class
#End Region

#Region "Properties"
        Public Overridable Property IdReciboDetalle() As Integer
            Get
                Return MyBase.Getint(ColumnNames.IdReciboDetalle)
            End Get
            Set(ByVal Value As Integer)
                MyBase.Setint(ColumnNames.IdReciboDetalle, Value)
            End Set
        End Property

        Public Overridable Property IdRecibo() As Integer
            Get
                Return MyBase.Getint(ColumnNames.IdRecibo)
            End Get
            Set(ByVal Value As Integer)
                MyBase.Setint(ColumnNames.IdRecibo, Value)
            End Set
        End Property

        Public Overridable Property IdVenta() As Integer
            Get
                Return MyBase.Getint(ColumnNames.IdVenta)
            End Get
            Set(ByVal Value As Integer)
                MyBase.Setint(ColumnNames.IdVenta, Value)
            End Set
        End Property

        Public Overridable Property FormaPago() As String
            Get
                Return MyBase.Getstring(ColumnNames.FormaPago)
            End Get
            Set(ByVal Value As String)
                MyBase.Setstring(ColumnNames.FormaPago, Value)
            End Set
        End Property

        Public Overridable Property Monto() As Decimal
            Get
                Return MyBase.Getdecimal(ColumnNames.Monto)
            End Get
            Set(ByVal Value As Decimal)
                MyBase.Setdecimal(ColumnNames.Monto, Value)
            End Set
        End Property

        Public Overridable Property Observaciones() As String
            Get
                Return MyBase.Getstring(ColumnNames.Observaciones)
            End Get
            Set(ByVal Value As String)
                MyBase.Setstring(ColumnNames.Observaciones, Value)
            End Set
        End Property

        Public Overridable Property IdCaja() As Integer
            Get
                Return MyBase.Getint(ColumnNames.IdCaja)
            End Get
            Set(ByVal Value As Integer)
                MyBase.Setint(ColumnNames.IdCaja, Value)
            End Set
        End Property

        Public Overridable Property FechaCaja() As DateTime
            Get
                Return MyBase.GetDateTime(ColumnNames.FechaCaja)
            End Get
            Set(ByVal Value As DateTime)
                MyBase.SetDateTime(ColumnNames.FechaCaja, Value)
            End Set
        End Property

        Public Overridable Property IdBanco() As Integer
            Get
                Return MyBase.Getint(ColumnNames.IdBanco)
            End Get
            Set(ByVal Value As Integer)
                MyBase.Setint(ColumnNames.IdBanco, Value)
            End Set
        End Property

        Public Overridable Property NroCheque() As String
            Get
                Return MyBase.Getstring(ColumnNames.NroCheque)
            End Get
            Set(ByVal Value As String)
                MyBase.Setstring(ColumnNames.NroCheque, Value)
            End Set
        End Property

        Public Overridable Property Titular() As String
            Get
                Return MyBase.Getstring(ColumnNames.Titular)
            End Get
            Set(ByVal Value As String)
                MyBase.Setstring(ColumnNames.Titular, Value)
            End Set
        End Property

        Public Overridable Property FechaChequeDiferido() As DateTime
            Get
                Return MyBase.GetDateTime(ColumnNames.FechaChequeDiferido)
            End Get
            Set(ByVal Value As DateTime)
                MyBase.SetDateTime(ColumnNames.FechaChequeDiferido, Value)
            End Set
        End Property


#End Region
	
	#Region "String Properties" 

		Public Overridable Property s_IdReciboDetalle As String
			Get
				If Me.IsColumnNull(ColumnNames.IdReciboDetalle) Then
					Return String.Empty
				Else
					Return MyBase.GetintAsString(ColumnNames.IdReciboDetalle)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.IdReciboDetalle)
				Else
					Me.IdReciboDetalle = MyBase.SetintAsString(ColumnNames.IdReciboDetalle, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_IdRecibo As String
			Get
				If Me.IsColumnNull(ColumnNames.IdRecibo) Then
					Return String.Empty
				Else
					Return MyBase.GetintAsString(ColumnNames.IdRecibo)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.IdRecibo)
				Else
					Me.IdRecibo = MyBase.SetintAsString(ColumnNames.IdRecibo, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_IdVenta As String
			Get
				If Me.IsColumnNull(ColumnNames.IdVenta) Then
					Return String.Empty
				Else
					Return MyBase.GetintAsString(ColumnNames.IdVenta)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.IdVenta)
				Else
					Me.IdVenta = MyBase.SetintAsString(ColumnNames.IdVenta, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_FormaPago As String
			Get
				If Me.IsColumnNull(ColumnNames.FormaPago) Then
					Return String.Empty
				Else
					Return MyBase.GetstringAsString(ColumnNames.FormaPago)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.FormaPago)
				Else
					Me.FormaPago = MyBase.SetstringAsString(ColumnNames.FormaPago, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_Monto As String
			Get
				If Me.IsColumnNull(ColumnNames.Monto) Then
					Return String.Empty
				Else
					Return MyBase.GetdecimalAsString(ColumnNames.Monto)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.Monto)
				Else
					Me.Monto = MyBase.SetdecimalAsString(ColumnNames.Monto, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_Observaciones As String
			Get
				If Me.IsColumnNull(ColumnNames.Observaciones) Then
					Return String.Empty
				Else
					Return MyBase.GetstringAsString(ColumnNames.Observaciones)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.Observaciones)
				Else
					Me.Observaciones = MyBase.SetstringAsString(ColumnNames.Observaciones, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_IdCaja As String
			Get
				If Me.IsColumnNull(ColumnNames.IdCaja) Then
					Return String.Empty
				Else
					Return MyBase.GetintAsString(ColumnNames.IdCaja)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.IdCaja)
				Else
					Me.IdCaja = MyBase.SetintAsString(ColumnNames.IdCaja, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_FechaCaja As String
			Get
				If Me.IsColumnNull(ColumnNames.FechaCaja) Then
					Return String.Empty
				Else
					Return MyBase.GetDateTimeAsString(ColumnNames.FechaCaja)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.FechaCaja)
				Else
					Me.FechaCaja = MyBase.SetDateTimeAsString(ColumnNames.FechaCaja, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_IdBanco As String
			Get
				If Me.IsColumnNull(ColumnNames.IdBanco) Then
					Return String.Empty
				Else
					Return MyBase.GetintAsString(ColumnNames.IdBanco)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.IdBanco)
				Else
					Me.IdBanco = MyBase.SetintAsString(ColumnNames.IdBanco, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_NroCheque As String
			Get
				If Me.IsColumnNull(ColumnNames.NroCheque) Then
					Return String.Empty
				Else
					Return MyBase.GetstringAsString(ColumnNames.NroCheque)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.NroCheque)
				Else
					Me.NroCheque = MyBase.SetstringAsString(ColumnNames.NroCheque, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_Titular As String
			Get
				If Me.IsColumnNull(ColumnNames.Titular) Then
					Return String.Empty
				Else
					Return MyBase.GetstringAsString(ColumnNames.Titular)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.Titular)
				Else
					Me.Titular = MyBase.SetstringAsString(ColumnNames.Titular, Value)
				End If
			End Set
		End Property

		Public Overridable Property s_FechaChequeDiferido As String
			Get
				If Me.IsColumnNull(ColumnNames.FechaChequeDiferido) Then
					Return String.Empty
				Else
					Return MyBase.GetDateTimeAsString(ColumnNames.FechaChequeDiferido)
				End If
			End Get
			Set(ByVal Value As String)
				If String.Empty = value Then
					Me.SetColumnNull(ColumnNames.FechaChequeDiferido)
				Else
					Me.FechaChequeDiferido = MyBase.SetDateTimeAsString(ColumnNames.FechaChequeDiferido, Value)
				End If
			End Set
		End Property


	#End Region  	

	#Region "Where Clause"
    Public Class WhereClause

        Public Sub New(ByVal entity As BusinessEntity)
            Me._entity = entity
        End Sub
		
		Public ReadOnly Property TearOff As TearOffWhereParameter
			Get
				If _tearOff Is Nothing Then
					_tearOff = new TearOffWhereParameter(Me)
				End If

				Return _tearOff
			End Get
		End Property

		#Region "TearOff's"
		Public class TearOffWhereParameter

			Public Sub New(ByVal clause As WhereClause)
				Me._clause = clause
			End Sub
		
	
			Public ReadOnly Property IdReciboDetalle() As WhereParameter
				Get
					Dim where As WhereParameter = New WhereParameter(ColumnNames.IdReciboDetalle, Parameters.IdReciboDetalle)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property IdRecibo() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.IdRecibo, Parameters.IdRecibo)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property IdVenta() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.IdVenta, Parameters.IdVenta)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property FormaPago() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.FormaPago, Parameters.FormaPago)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property Monto() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.Monto, Parameters.Monto)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property Observaciones() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.Observaciones, Parameters.Observaciones)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property IdCaja() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.IdCaja, Parameters.IdCaja)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property FechaCaja() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.FechaCaja, Parameters.FechaCaja)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property IdBanco() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.IdBanco, Parameters.IdBanco)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property NroCheque() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.NroCheque, Parameters.NroCheque)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property Titular() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.Titular, Parameters.Titular)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property

                Public ReadOnly Property FechaChequeDiferido() As WhereParameter
                    Get
                        Dim where As WhereParameter = New WhereParameter(ColumnNames.FechaChequeDiferido, Parameters.FechaChequeDiferido)
                        Me._clause._entity.Query.AddWhereParameter(where)
                        Return where
                    End Get
                End Property


			Private _clause as WhereClause
		End Class
		#End Region	

		Public ReadOnly Property IdReciboDetalle() As WhereParameter 
			Get
				If _IdReciboDetalle_W Is Nothing Then
					_IdReciboDetalle_W = TearOff.IdReciboDetalle
				End If
				Return _IdReciboDetalle_W
			End Get
		End Property

		Public ReadOnly Property IdRecibo() As WhereParameter 
			Get
				If _IdRecibo_W Is Nothing Then
					_IdRecibo_W = TearOff.IdRecibo
				End If
				Return _IdRecibo_W
			End Get
		End Property

		Public ReadOnly Property IdVenta() As WhereParameter 
			Get
				If _IdVenta_W Is Nothing Then
					_IdVenta_W = TearOff.IdVenta
				End If
				Return _IdVenta_W
			End Get
		End Property

		Public ReadOnly Property FormaPago() As WhereParameter 
			Get
				If _FormaPago_W Is Nothing Then
					_FormaPago_W = TearOff.FormaPago
				End If
				Return _FormaPago_W
			End Get
		End Property

		Public ReadOnly Property Monto() As WhereParameter 
			Get
				If _Monto_W Is Nothing Then
					_Monto_W = TearOff.Monto
				End If
				Return _Monto_W
			End Get
		End Property

		Public ReadOnly Property Observaciones() As WhereParameter 
			Get
				If _Observaciones_W Is Nothing Then
					_Observaciones_W = TearOff.Observaciones
				End If
				Return _Observaciones_W
			End Get
		End Property

		Public ReadOnly Property IdCaja() As WhereParameter 
			Get
				If _IdCaja_W Is Nothing Then
					_IdCaja_W = TearOff.IdCaja
				End If
				Return _IdCaja_W
			End Get
		End Property

		Public ReadOnly Property FechaCaja() As WhereParameter 
			Get
				If _FechaCaja_W Is Nothing Then
					_FechaCaja_W = TearOff.FechaCaja
				End If
				Return _FechaCaja_W
			End Get
		End Property

		Public ReadOnly Property IdBanco() As WhereParameter 
			Get
				If _IdBanco_W Is Nothing Then
					_IdBanco_W = TearOff.IdBanco
				End If
				Return _IdBanco_W
			End Get
		End Property

		Public ReadOnly Property NroCheque() As WhereParameter 
			Get
				If _NroCheque_W Is Nothing Then
					_NroCheque_W = TearOff.NroCheque
				End If
				Return _NroCheque_W
			End Get
		End Property

		Public ReadOnly Property Titular() As WhereParameter 
			Get
				If _Titular_W Is Nothing Then
					_Titular_W = TearOff.Titular
				End If
				Return _Titular_W
			End Get
		End Property

		Public ReadOnly Property FechaChequeDiferido() As WhereParameter 
			Get
				If _FechaChequeDiferido_W Is Nothing Then
					_FechaChequeDiferido_W = TearOff.FechaChequeDiferido
				End If
				Return _FechaChequeDiferido_W
			End Get
		End Property

		Private _IdReciboDetalle_W As WhereParameter = Nothing
		Private _IdRecibo_W As WhereParameter = Nothing
		Private _IdVenta_W As WhereParameter = Nothing
		Private _FormaPago_W As WhereParameter = Nothing
		Private _Monto_W As WhereParameter = Nothing
		Private _Observaciones_W As WhereParameter = Nothing
		Private _IdCaja_W As WhereParameter = Nothing
		Private _FechaCaja_W As WhereParameter = Nothing
		Private _IdBanco_W As WhereParameter = Nothing
		Private _NroCheque_W As WhereParameter = Nothing
		Private _Titular_W As WhereParameter = Nothing
		Private _FechaChequeDiferido_W As WhereParameter = Nothing

			Public Sub WhereClauseReset()

			_IdReciboDetalle_W = Nothing
			_IdRecibo_W = Nothing
			_IdVenta_W = Nothing
			_FormaPago_W = Nothing
			_Monto_W = Nothing
			_Observaciones_W = Nothing
			_IdCaja_W = Nothing
			_FechaCaja_W = Nothing
			_IdBanco_W = Nothing
			_NroCheque_W = Nothing
			_Titular_W = Nothing
			_FechaChequeDiferido_W = Nothing
				Me._entity.Query.FlushWhereParameters()

			End Sub
	
		Private _entity As BusinessEntity
		Private _tearOff As TearOffWhereParameter
    End Class	

	Public ReadOnly Property Where() As WhereClause
		Get
			If _whereClause Is Nothing Then
				_whereClause = New WhereClause(Me)
			End If
	
			Return _whereClause
		End Get
	End Property
	
	Private _whereClause As WhereClause = Nothing	
#End Region	

#Region "Aggregate Clause"
    Public Class AggregateClause

        Public Sub New(ByVal entity As BusinessEntity)
            Me._entity = entity
        End Sub
		
		Public ReadOnly Property TearOff As TearOffAggregateParameter
			Get
				If _tearOff Is Nothing Then
					_tearOff = new TearOffAggregateParameter(Me)
				End If

				Return _tearOff
			End Get
		End Property

		#Region "AggregateParameter TearOff's"
		Public class TearOffAggregateParameter

			Public Sub New(ByVal clause As AggregateClause)
				Me._clause = clause
			End Sub
		
	
		Public ReadOnly Property IdReciboDetalle() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.IdReciboDetalle, Parameters.IdReciboDetalle)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property IdRecibo() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.IdRecibo, Parameters.IdRecibo)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property IdVenta() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.IdVenta, Parameters.IdVenta)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property FormaPago() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.FormaPago, Parameters.FormaPago)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property Monto() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.Monto, Parameters.Monto)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property Observaciones() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.Observaciones, Parameters.Observaciones)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property IdCaja() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.IdCaja, Parameters.IdCaja)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property FechaCaja() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.FechaCaja, Parameters.FechaCaja)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property IdBanco() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.IdBanco, Parameters.IdBanco)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property NroCheque() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.NroCheque, Parameters.NroCheque)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property Titular() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.Titular, Parameters.Titular)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property

		Public ReadOnly Property FechaChequeDiferido() As AggregateParameter
			Get
				Dim where As AggregateParameter = New AggregateParameter(ColumnNames.FechaChequeDiferido, Parameters.FechaChequeDiferido)
				Me._clause._entity.Query.AddAggregateParameter(where)
				Return where
			End Get
		End Property


			Private _clause as AggregateClause
		End Class
		#End Region	

		Public ReadOnly Property IdReciboDetalle() As AggregateParameter 
			Get
				If _IdReciboDetalle_W Is Nothing Then
					_IdReciboDetalle_W = TearOff.IdReciboDetalle
				End If
				Return _IdReciboDetalle_W
			End Get
		End Property

		Public ReadOnly Property IdRecibo() As AggregateParameter 
			Get
				If _IdRecibo_W Is Nothing Then
					_IdRecibo_W = TearOff.IdRecibo
				End If
				Return _IdRecibo_W
			End Get
		End Property

		Public ReadOnly Property IdVenta() As AggregateParameter 
			Get
				If _IdVenta_W Is Nothing Then
					_IdVenta_W = TearOff.IdVenta
				End If
				Return _IdVenta_W
			End Get
		End Property

		Public ReadOnly Property FormaPago() As AggregateParameter 
			Get
				If _FormaPago_W Is Nothing Then
					_FormaPago_W = TearOff.FormaPago
				End If
				Return _FormaPago_W
			End Get
		End Property

		Public ReadOnly Property Monto() As AggregateParameter 
			Get
				If _Monto_W Is Nothing Then
					_Monto_W = TearOff.Monto
				End If
				Return _Monto_W
			End Get
		End Property

		Public ReadOnly Property Observaciones() As AggregateParameter 
			Get
				If _Observaciones_W Is Nothing Then
					_Observaciones_W = TearOff.Observaciones
				End If
				Return _Observaciones_W
			End Get
		End Property

		Public ReadOnly Property IdCaja() As AggregateParameter 
			Get
				If _IdCaja_W Is Nothing Then
					_IdCaja_W = TearOff.IdCaja
				End If
				Return _IdCaja_W
			End Get
		End Property

		Public ReadOnly Property FechaCaja() As AggregateParameter 
			Get
				If _FechaCaja_W Is Nothing Then
					_FechaCaja_W = TearOff.FechaCaja
				End If
				Return _FechaCaja_W
			End Get
		End Property

		Public ReadOnly Property IdBanco() As AggregateParameter 
			Get
				If _IdBanco_W Is Nothing Then
					_IdBanco_W = TearOff.IdBanco
				End If
				Return _IdBanco_W
			End Get
		End Property

		Public ReadOnly Property NroCheque() As AggregateParameter 
			Get
				If _NroCheque_W Is Nothing Then
					_NroCheque_W = TearOff.NroCheque
				End If
				Return _NroCheque_W
			End Get
		End Property

		Public ReadOnly Property Titular() As AggregateParameter 
			Get
				If _Titular_W Is Nothing Then
					_Titular_W = TearOff.Titular
				End If
				Return _Titular_W
			End Get
		End Property

		Public ReadOnly Property FechaChequeDiferido() As AggregateParameter 
			Get
				If _FechaChequeDiferido_W Is Nothing Then
					_FechaChequeDiferido_W = TearOff.FechaChequeDiferido
				End If
				Return _FechaChequeDiferido_W
			End Get
		End Property

		Private _IdReciboDetalle_W As AggregateParameter = Nothing
		Private _IdRecibo_W As AggregateParameter = Nothing
		Private _IdVenta_W As AggregateParameter = Nothing
		Private _FormaPago_W As AggregateParameter = Nothing
		Private _Monto_W As AggregateParameter = Nothing
		Private _Observaciones_W As AggregateParameter = Nothing
		Private _IdCaja_W As AggregateParameter = Nothing
		Private _FechaCaja_W As AggregateParameter = Nothing
		Private _IdBanco_W As AggregateParameter = Nothing
		Private _NroCheque_W As AggregateParameter = Nothing
		Private _Titular_W As AggregateParameter = Nothing
		Private _FechaChequeDiferido_W As AggregateParameter = Nothing

		Public Sub AggregateClauseReset()

		_IdReciboDetalle_W = Nothing
		_IdRecibo_W = Nothing
		_IdVenta_W = Nothing
		_FormaPago_W = Nothing
		_Monto_W = Nothing
		_Observaciones_W = Nothing
		_IdCaja_W = Nothing
		_FechaCaja_W = Nothing
		_IdBanco_W = Nothing
		_NroCheque_W = Nothing
		_Titular_W = Nothing
		_FechaChequeDiferido_W = Nothing
			Me._entity.Query.FlushAggregateParameters()

		End Sub
	
		Private _entity As BusinessEntity
		Private _tearOff As TearOffAggregateParameter
    End Class	

	Public ReadOnly Property Aggregate() As AggregateClause
		Get
			If _aggregateClause Is Nothing Then
				_aggregateClause = New AggregateClause(Me)
			End If
	
			Return _aggregateClause
		End Get
	End Property
	
	Private _aggregateClause As AggregateClause = Nothing	
#End Region	

	Protected Overrides Function GetInsertCommand() As IDbCommand
	
		Dim cmd As SqlCommand = New SqlCommand
		cmd.CommandType = CommandType.StoredProcedure
		cmd.CommandText = "[" + Me.SchemaStoredProcedure + "proc_si_recibo_detalleInsert]" 
	    
		CreateParameters(cmd)
		
		Dim p As SqlParameter
		p = cmd.Parameters(Parameters.IdReciboDetalle.ParameterName)
		p.Direction = ParameterDirection.Output
    
		Return cmd 

  	End Function
	
	Protected Overrides Function GetUpdateCommand() As IDbCommand
	
		Dim cmd As SqlCommand = New SqlCommand
		cmd.CommandType = CommandType.StoredProcedure    
		cmd.CommandText = "[" + Me.SchemaStoredProcedure + "proc_si_recibo_detalleUpdate]" 
		
		CreateParameters(cmd) 
		    
		Return cmd
	
	End Function	
	
	Protected Overrides Function GetDeleteCommand() As IDbCommand
	
		Dim cmd As SqlCommand = New SqlCommand
		cmd.CommandType = CommandType.StoredProcedure    
		cmd.CommandText = "[" + Me.SchemaStoredProcedure + "proc_si_recibo_detalleDelete]" 
		
		Dim p As SqlParameter
		p = cmd.Parameters.Add(Parameters.IdReciboDetalle)
		p.SourceColumn = ColumnNames.IdReciboDetalle
		p.SourceVersion = DataRowVersion.Current

  
		Return cmd
	
	End Function	
	
	Private Sub CreateParameters(ByVal cmd As SqlCommand)
	
		Dim p As SqlParameter
		p = cmd.Parameters.Add(Parameters.IdReciboDetalle)
		p.SourceColumn = ColumnNames.IdReciboDetalle
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.IdRecibo)
		p.SourceColumn = ColumnNames.IdRecibo
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.IdVenta)
		p.SourceColumn = ColumnNames.IdVenta
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.FormaPago)
		p.SourceColumn = ColumnNames.FormaPago
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.Monto)
		p.SourceColumn = ColumnNames.Monto
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.Observaciones)
		p.SourceColumn = ColumnNames.Observaciones
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.IdCaja)
		p.SourceColumn = ColumnNames.IdCaja
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.FechaCaja)
		p.SourceColumn = ColumnNames.FechaCaja
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.IdBanco)
		p.SourceColumn = ColumnNames.IdBanco
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.NroCheque)
		p.SourceColumn = ColumnNames.NroCheque
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.Titular)
		p.SourceColumn = ColumnNames.Titular
		p.SourceVersion = DataRowVersion.Current

		p = cmd.Parameters.Add(Parameters.FechaChequeDiferido)
		p.SourceColumn = ColumnNames.FechaChequeDiferido
		p.SourceVersion = DataRowVersion.Current


	End Sub	

End Class

End NameSpace

